package com.googlecode.flealancemarket.metamodel.beans;

import com.googlecode.flealancemarket.core.beans.BaseBean;
import com.googlecode.flealancemarket.metamodel.Category;
import com.googlecode.flealancemarket.metamodel.CategoryGroup;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;

@Entity
public class CategoryGroupBean extends BaseBean implements CategoryGroup {

    private String name;
    private List<Category> categories;

    @Basic
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public CategoryGroupBean(){
        super();
    }
    

    @OneToMany(targetEntity=CategoryBean.class, mappedBy = "categoryGroup", fetch = FetchType.EAGER)
    public List<Category> getCategories() {
        return categories;
    }

    public void setCategories(List<Category> c) {
        categories = c;
    }
}